import AxiosServe from '@/utils/request.js'

/* 添加日志  */
export const RequestLogAdd = (content, logtime, mid, category) => {
    return AxiosServe({
        url: '/api/logadd',
        method: 'post',
        data: {
            content,
            logtime,
            mid,
            category
        }
    })
}

/* 
  日志列表
*/
export const RequestLogListPage = (pageNo, pageSize, username, name = null, startTime = null, endTime = null) => {
    return AxiosServe({
        url: '/api/log/list_page',
        method: 'get',
        params: {
            pageNo,
            pageSize,
            username, // 过滤显示当前用户日志
            name,  // 查询用户
            startTime,
            endTime
        }
    })
}

/**
 * 查询日志
 * @param {} id 
 */
export const RequestLogFind = (id) => {
    return AxiosServe({
        url: '/api/log/find',
        method: 'get',
        params: {
            id
        }
    })
}

/**
 * 修改日志
 */
export const RequestLogUpdate = (id, content) => {
    return AxiosServe({
        url: '/api/log/update',
        method: 'post',
        data: {
            id,
            content
        }
    })
}
/**
 * 删除日志
 */
export const RequestLogDelete = (id) => {
    return AxiosServe({
        url: '/api/log/delete',
        method: 'get',
        params: {
            id
        }
    })
}

